package com.example.invoke.extend.service;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class ServiceRegistry {

    private static Map<String, ServiceBean> map = new ConcurrentHashMap<>();

    public static synchronized ServiceBean getService(String serviceId) {
        ServiceBean serviceBean = map.get(serviceId);
        if (serviceBean == null) {
            serviceBean = new ServiceBean();
            map.putIfAbsent(serviceId, serviceBean);
        }
        return serviceBean;
    }
}
